<template>
	<view>
		<view class="tabs">
			<view v-for="(item,index) in list" :key="index" :class="{active:num==index}" @click="table(index)">{{item.title}}</view>
		</view>

		<view class="tabContent">
			<view v-for="(item,index) in list" :key="index" v-show="index==num">
				<view v-for="(tabCon,index) in item.tabsCon" :key="index">
					<view class='noticeList'>
						<view class="noticeInfo">
							<image v-if="tabCon.seen == true" src="../../static/gonggao_Invalid2x.png"></image>
							<image v-else src="../../static/gonggao2x.png"></image>
							<view class="ml_20">
								<view class="noticeTitle" :class="tabCon.seen == true? 'color_A6' : ''">{{tabCon.title}}
									<image v-if="tabCon.new" src="../../static/new2x.png"></image>
								</view>
								<view class="time">
									<image src="../../static/icon_time2x.png"></image>
									<text>{{tabCon.date}}</text>
									<image src="../../static/icon_See2x.png"></image>
									<text>{{tabCon.num}}k</text>
								</view>
							</view>
						</view>
						<image src="../../static/more2x.png" class="more"></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				num: 0,
				list: [{
						title: '我的公告',
						tabsCon: [{
								title: '年度工作表彰大会通知',
								date: '02/19',
								num: 7.2,
								new: true,
								seen: ''
							},
							{
								title: '权益变动通知',
								date: '02/19',
								num: 7.2,
								new: '',
								seen: ''
							},
							{
								title: '清明节放假通知',
								date: '02/19',
								num: 7.2,
								new: '',
								seen: true
							}
						]
					},
					{
						title: '系统公告',
						tabsCon: [{
							title: '权益变动通知',
							date: '02/19',
							num: 7.2,
							new: '',
							seen: ''
						}]
					}
				]
			}
		},
		methods: {
			// tab
			table(index) {
				this.num = index;
			}
		}
	}
</script>

<style>
	/* tab */
	.tabs {
		display: flex;
		line-height: 2.5;
		background: #fff;
	}

	.tabs view {
		flex: 1;
		color: #686868;
		text-align: center;
		font-size: 30rpx;
	}

	.tabs .active {
		color: #000;
		position: relative;
	}

	.tabs .active::after {
		content: "";
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		width: 30rpx;
		height: 5rpx;
		background: #1F7AFF;
		border-radius: 5rpx;
		margin: 0 auto;
	}


	/* 我的公告 */
	.noticeList {
		padding: 30rpx;
		background-color: #fff;
		margin-top: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.noticeInfo {
		display: flex;
		align-items: center;
	}

	.noticeInfo>image {
		width: 80rpx;
		height: 80rpx;
	}
	.noticeTitle{
		font-size: 28rpx;
		margin-bottom: 10rpx;
	}
		
	.noticeTitle image {
		width: 26rpx;
		height: 20rpx;
		margin-left: 10rpx;
	}

	.time image {
		width: 22rpx;
		height: 22rpx;
		vertical-align: middle;
		margin-right: 10rpx;
	}

	.time text {
		font-size: 20rpx;
		color: #C9CDD0;
		margin-right: 30rpx;
	}

	.more {
		width: 12rpx;
		height: 22rpx;
	}
</style>
